<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <title>粘贴上传图片</title>
    <style>
        * {
            box-sizing: border-box;
        }

        body {
        }

        #app {
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        #app > h1 {
            font-size: 25px;
            color: #333;
            margin: 20px 0 5px 0;
        }

        #app .info {
            margin-top: 5px;
            margin-bottom: 15px;
        }

        a {
            text-decoration: none;
        }

        #app .info a {
            color: #333333;
        }

        #app .info a.active {
            color: cornflowerblue;
        }

        #tar_box {
            width: 500px;
            height: 300px;
            border: 1px solid #6d84b3;
            position: relative;
            border-radius: 5px;
            transition: all 0.3s;
            padding: 20px;
        }

        #tar_box:focus {
            border: 1px solid #767;
        }

        #tar_box::after {
            display: flex;
            justify-content: center;
            align-items: center;
            position: absolute;
            width: 100%;
            height: 100%;
            left: 0;
            top: 0;
            content: '图片上传区域';
            color: #777;
        }

        #app .img_list_msg {
            display: flex;
            width: 500px;
            justify-content: left;
            margin-top: 20px;
            margin-bottom: 5px;
            font-size: 12px;
            color: #555;
        }

        #img_list {
            width: 500px;
            max-height: 500px;
            display: flex;
            flex-wrap: wrap;
        }

        #img_list img {
            height: 100px;
            margin-bottom: 20px;
            margin-right: 20px;
            border-radius: 5px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
            cursor: pointer;
        }
    </style>
    <link rel="stylesheet" href="/static/viewer/css/viewer.css">
    <link rel="stylesheet" href="/static/elementui/theme-chalk/index.css">

</head>
<body>
<div id="app">
    <h1>基于复制粘贴的图片上传</h1>
    <div class="info">
        <a href="/">直接上传到static目录</a>
        <a href="/up_sql/">上传到数据库</a>
        <a href="/up_drag_drop/" class="active">拖拽上传</a>
        <a href="/paste_url/">粘贴图片url上传</a>
    </div>
    <el-upload
            class="upload-demo"
            drag
            action="/element_upload/"
            multiple>
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
        <div class="el-upload__tip" slot="tip">只能上传jpg/png文件，且不超过500kb</div>
    </el-upload>
    <div class="img_list_msg">
        已上传图片列表
    </div>
    <div id="img_list">
        {% for cover in cover_list %}
            <img src="{{ cover.url.url }}" title="上传时间：{{ cover.create_date }}" alt="">
        {% endfor %}
    </div>
</div>

<script src="/static/js/vue.js"></script>
<script src="/static/elementui/index.js"></script>
<script src="/static/js/jquery.js"></script>
<script>
    new Vue({
        el: '#app',
        methods: {}
    })

</script>
<script src="/static/viewer/js/viewer.js"></script>
<script>
    $(function () {
        $('#img_list').viewer({
            url: 'src',
        });
    });
</script>
</body>
</html>